import request from '@/utils/request';

// 查询司机列表
export function getCarList(query) {
  return request({
    url: `/car?pageNum=${query.pageNum}&pageSize=${query.pageSize}`,
    method: 'post',
    data: query,
  });
}

// 查询司机详细
export function getCar(id) {
  return request({
    url: '/car/' + id,
    method: 'get',
  });
}

// 新增司机
export function addCar(data) {
  return request({
    url: '/car/add',
    method: 'post',
    data: data,
  });
}

// 修改司机
export function updateCar(data) {
  return request({
    url: '/car',
    method: 'put',
    data: data,
  });
}

// 删除司机
export function delCar(id) {
  return request({
    url: '/car?id=' + id,
    method: 'delete',
  });
}
